
<%@ page import="java.util.HashMap,
                java.util.ArrayList,
                java.util.Iterator,
                com.scalar.chiptrack.alarms.Alarm,
                com.scalar.chiptrack.alarms.dao.AlarmDAO,
                 com.scalar.chiptrack.commons.Constants"%>
<%@ page import="com.scalar.chiptrack.users.Functionality"%>
<%@ page import="com.scalar.chiptrack.operations.discrepancyLotsNotifications.DiscrepancyLot"%>
<%@ page import="com.scalar.chiptrack.operations.discrepancyLotsNotifications.dao.DiscrepancyLotsNotificationsDAO"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/jsp/alarms_warnings.jsp"/>

<html:html>

<HEAD><TITLE>Scalar Soft - ChipTrac</TITLE>


<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<script language='javascript'>

function removeAlarmsQuote()
{
    var form1 = document.alarmsWarningsForm.select_QUOTE;
    var count1=0;
	if (typeof form1.length =='undefined') {
		if (document.alarmsWarningsForm.select_QUOTE.checked==true)
			count1 = count1+1;
	}

	for( var i=0; i< form1.length;i++ )
	{
		if(form1[i].checked+""=='true')
		{
			count1++;
		}

	}
	if(count1==0)
	{
		var pa=document.getElementById("errors");
		pa.innerHTML = "<li> Check one or more Checkboxes to delete";
		return;
	}

	document.alarmsWarningsForm.submit();

}

function removeAlarmsSalesOrder()
{
	var form = document.alarmsWarningsForm.select_SALES_ORDER;
    var count=0;
	if (typeof form.length =='undefined') {
		if (document.alarmsWarningsForm.select_SALES_ORDER.checked==true)
			count = count+1;
	}

	for( var i=0; i< form.length;i++ )
	{
		if(form[i].checked+""=='true')
		{
			count++;
		}

	}
	if(count==0)
	{
		var pa=document.getElementById("errors");
		pa.innerHTML = "<li> Check one or more Checkboxes to delete";
		return;
	}

	document.alarmsWarningsForm.submit();

}

function removeAlarmsSampleOrder()
{
	var form = document.alarmsWarningsForm.select_SAMPLE_ORDER;
    var count=0;
	if (typeof form.length =='undefined') {
		if (document.alarmsWarningsForm.select_SAMPLE_ORDER.checked==true)
			count = count+1;
	}
	for( var i=0; i< form.length;i++ )
	{
		if(form[i].checked+""=='true')
		{
			count++;
		}
	}
	if(count==0)
	{
		var pa=document.getElementById("errors");
		pa.innerHTML = "<li> Check one or more Checkboxes to delete";
		return;
	}
	document.alarmsWarningsForm.submit();
}

function viewDetails(alarmId, alarmType)
{
    var tempURL = '<%=chipTracContext%>/alarmsWarnings.do?action=show&alarmId=' + alarmId + '&alarmType=' + alarmType
    newWindow = window.open (tempURL,'optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=800,height=400,resizable=yes');
    newWindow.focus();
}

function setSelectAll(object){

	var selectAllName = object.name;
    var tempname=selectAllName.substring(0,selectAllName.length-1);

   	var tempobj1 = eval("document.alarmsWarningsForm."+tempname+"1");
	var tempobj2 = eval("document.alarmsWarningsForm."+tempname+"2");


	var result = object.checked+"";

    result = (result == 'true' )? true : "";
    tempobj1.checked=result;
	tempobj2.checked=result;

	var cGroup = eval('document.alarmsWarningsForm.'+object.value);

	setAllCheckBoxes(result,cGroup);

}

function setAllCheckBoxes(status, cGroup){
    var idx;
    if ( typeof cGroup == 'object' ){

        if ( typeof cGroup.length == 'undefined'){
            cGroup.checked = status;
        }
        else {
            for (idx = 0; idx < cGroup.length;idx++){
                cGroup[idx].checked = status;
            }
        }
    }
}

function deSelectAll(object)
{
    var aCheckBoxes = document.getElementsByName(object.name);

     var selectedName = object.name;
     var tempname = selectedName.substring(7,selectedName.length);
     var tempobj1 = eval("document.alarmsWarningsForm."+tempname+"1");
     var tempobj2 = eval("document.alarmsWarningsForm."+tempname+"2");

    if (aCheckBoxes.length == null) {
        if (aCheckBoxes.checked == true){
                tempobj1.checked = true;
                tempobj2.checked = true;
        }
        else {
                tempobj1.checked = false;
                tempobj2.checked = false;
       }
    }
    else {
        var status = true ;
        for (var index = 0 ; index < aCheckBoxes.length ; index++) {
            if ( aCheckBoxes[index].checked == false) {
                status = false;
                tempobj1.checked = false;
                tempobj2.checked = false;
                break;
            }
        }

        if (status == true ){
                tempobj1.checked = true;
                tempobj2.checked = true;
        }
    }

}

function ShowHide( menuID)
{
    var menuObj = document.getElementById("Link"+menuID);
    var cellbk = document.getElementById("Head"+menuID);
    var messagesHolder = document.getElementById("infoMessages");
    messagesHolder.innerHTML = "";
    messagesHolder = document.getElementById("errorMessages");
    messagesHolder.innerHTML = "";
    messagesHolder = document.getElementById("errors");
    messagesHolder.innerHTML = "";


    if ( menuObj.className == "LINKSON")
    {
        menuObj.className="LINKSOFF"
        cellbk.style.backgroundColor="#FFFFFF"
        statusMessage = 'Click here to Expand';
    }
    else
    {
        menuObj.className="LINKSON"
        cellbk.style.backgroundColor="#FFFFFF"
        statusMessage = 'Click here to Collapse';
    }
}

function setSelectAll_sd(object){

    var selectAllName = object.name;
    var tempname=selectAllName.substring(0,selectAllName.length-1);

    var tempobj1 = eval("document.discrepancyLots."+tempname+"1");
    var tempobj2 = eval("document.discrepancyLots."+tempname+"2");


    var result = object.checked+"";

    result = (result == 'true' )? true : "";
    tempobj1.checked=result;
    tempobj2.checked=result;

    var cGroup = eval('document.discrepancyLots.'+object.value);

    setAllCheckBoxes(result,cGroup);

}

function deSelectAll_sd(object)
{
    var aCheckBoxes = document.getElementsByName(object.name);
    var selectedName = object.name;
    var tempobj1 = eval("document.discrepancyLots."+selectedName+"_1");
    var tempobj2 = eval("document.discrepancyLots."+selectedName+"_2");

    if (aCheckBoxes.length == null) {
        if (aCheckBoxes.checked == true){
                tempobj1.checked = true;
                tempobj2.checked = true;
        }
        else {
                tempobj1.checked = false;
                tempobj2.checked = false;
       }
    }
    else {
        var status = true ;
        for (var index = 0 ; index < aCheckBoxes.length ; index++) {
            if ( aCheckBoxes[index].checked == false) {
                status = false;
                tempobj1.checked = false;
                tempobj2.checked = false;
                break;
            }
        }

        if (status == true ){
                tempobj1.checked = true;
                tempobj2.checked = true;
        }
    }
}

function removeDiscrepancyLots( notificationType )
{
    document.discrepancyLots.action = document.discrepancyLots.action + '?action=delete&notificationType='+notificationType;
    document.discrepancyLots.submit();
}

function closedlotnotifications()
{
   var tempURL = '<%=chipTracContext%>/jsp/operations/show_closed_discrepancy_lots.jsp'
   newWindow = window.open (tempURL,'optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=800,height=400,resizable=yes');
}

</script>

<style>
<!--
a.nav:link   { font-family: Verdana,Arial,San Serif; font-size: 10px; text-decoration: none }
a.nav:visited { font-family: Verdana,Arial,San Serif; font-size: 10px; text-decoration: none }
a.nav:active { font-family: Verdana,Arial,San Serif; font-size: 10px; text-decoration: none }
a.nav:hover  { font-family: Verdana,Arial,San Serif; font-size: 10px; text-decoration: none; color: #000000 }
.HEADING     { cursor: hand; font-family: Verdana,Arial,San Serif; font-size: 12px; color: #000000;
               background-color: #FFFFFFF; font-weight: none;
               border: 1 solid #000000 }
.LINKSOFF    { display: none; font-family: Verdana,Arial,San Serif; font-size: 12px; color: #000000; }
.LINKSON     { display: inline; font-family: Verdana,Arial,San Serif; font-size: 12px; color: #000000; }
-->
</style>

<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor='#ffffff' leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<TABLE  id="datatable"  cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>

<BR>
<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=100 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="80%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>

<%
    int index = 0;
%>

<html:form name='alarmsWarningsForm' type='com.scalar.chiptrack.ChipTrackActionForm' action='/alarmsWarnings.do?action=confirm'>

<table align="left" border="0" width="85%">
<tr><td  id="infoMessages"><chiptrack:info styleClass='NArialL'/></td></tr>
<tr><td  id="errorMessages"><chiptrack:errors styleClass='NArialL'/></td></tr>

    <tr><td>
        <center><span class="NArialW"><img src='<%=chipTracContext%>/jsp/includes/images/alarm_icon.jpg' height='46' width='34'>&nbsp;Notifications and Warnings</span></center>
    </td></tr>

    <a name="#top"/>
	<tr><td><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=30></td></tr>
	<tr><td colspan=7 align="left" class='NArialL'><font styleClass="NArialL" id='errors' color="FF0000"  >&nbsp;</font></td></tr>

    <%
        HashMap alarmMap = AlarmDAO.loadAlarmsByRecipient (user.getUserId());

        if ((alarmMap == null) || (alarmMap.isEmpty())) {
    %>
            <tr><td align='center'><font class='NArialL'><font color='green'>No Notifications or Warnings</font></font></td></tr>
    <%
        }
        else {
            Iterator keys = alarmMap.keySet().iterator();
            String key = null;
            ArrayList alarmList = null;
            Alarm alarm = null;

            String headValue = null;
            String linkValue = null;
            String showHide = null;
    %>
        <tr><td align='center'><font class='NArialS'><font color='blue'>[Click on bars to Expand or Collapse the List]</font></font></td></tr>
    <%
            while (keys.hasNext()) {
                key = (String) keys.next();
                alarmList = (ArrayList) alarmMap.get (key);

                headValue = "head" + index;              //
                linkValue = "link" + index;              // Values used by the script
                showHide = "ShowHide(" + index + ")";   //
    %>

            <tr><td ID='<%=headValue%>' ALIGN='left' CLASS="HEADING" ONCLICK='<%=showHide%>'  onMouseOver="window.status='Click here to Expand/Collapse';return true" onmouseout="window.status='';return true"><%=key%> Notifications</td></tr>
            <tr><td ALIGN="left" bgcolor="#FFFFFF">
            <div ID='<%=linkValue%>' CLASS="LINKSOFF">

            <table border="0" width="100%"  align=left>

                <tr><td><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=5></td></tr>

                <tr bgcolor="#993333">
                    <td width='20%' align='center'><font class='NArialL'><font color='#FFFFFF'>Select to Remove</font></font></td>
                    <td width='80%'><font class='NArialL'><font color='#FFFFFF'>&nbsp;&nbsp;</font></font></td>
                </tr>
				<tr bgcolor="#FFFFEE">
					<td width='20%' align='center'> <font class='NArialL'><input id="selectallrows" type="checkbox" name='<%=(key.trim()).replace(' ','_')+"1"%>'  value='<%="select_" + (key.trim()).replace(' ','_')%>' onClick = "javascript:setSelectAll(this)">Select All</font></td>
					<td width='80%'><font class='NArialL'><font color='#FFFFFF'>&nbsp;&nbsp;</font></font></td>
				</tr>
    <%
                if ((alarmList != null) && (alarmList.isEmpty() == false)) {
                    int size = alarmList.size();

                    String bgColor[] = {"#DEE1E2", "#FFFFEE"};
                    for (int i=0; i<size; i++) {
                        alarm = (Alarm) alarmList.get (i);


    %>
                        <tr bgcolor='<%=bgColor[i%2]%>'>
                            <td width='20%' align='center'><font class='NArialL'><input  type='checkbox' name='<%="select_" + (key.trim()).replace(' ','_')%>' value='<%=alarm.getId()%>' onClick ="javascript:deSelectAll(this)"></font></td>
                            <td width='80%'>
                                <font class='NArialL'>&nbsp;&nbsp;
                                    <a href="javascript:viewDetails ('<%=alarm.getId()%>', '<%=key%>');" onMouseOver="window.status='Click here to get the details';return true" onmouseout="window.status='';return true">
                                        <%=alarm.getName()%>
                                    </a>
                                </font></td>
                        </tr>
    <%}%>
					<tr bgcolor="#FFFFEE">
						<td width='20%' align='center'> <font class='NArialL'><input  type="checkbox" name='<%=(key.trim()).replace(' ','_')+"2"%>'  value='<%="select_" + (key.trim()).replace(' ','_')%>' onClick = "javascript:setSelectAll(this)" >Select All</font></td>
						<td width='80%'><font class='NArialL'><font color='#FFFFFF'>&nbsp;&nbsp;</font></font></td>
					</tr>
                    <tr><td colspan='2'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
                    <tr><td align='center' class='NArialL' colspan='2'>
                   <!-- if else block added by gandhi on 02-May-2004 8pm -->
                    <% if(key.equalsIgnoreCase(Constants.QUOTE_ALARM))
                    {%>
                    <a href="javascript:removeAlarmsQuote()"  onMouseOver="window.status='Click here to delete the selected Quotes';return true" onmouseout="window.status='';return true">Delete</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <%}
                    else if( key.equalsIgnoreCase(Constants.SAMPLE_ORDER_ALARM))
                    {%>
                    <a href="javascript:removeAlarmsSampleOrder()" onMouseOver="window.status='Click here to delete the selected Sample Sales Orders';return true" onmouseout="window.status='';return true">Delete</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <%}
                    else
                    {
                    %>
                    <a href="javascript:removeAlarmsSalesOrder()" onMouseOver="window.status='Click here to delete the selected Sales Orders';return true" onmouseout="window.status='';return true">Delete</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <%
                    }
                    %>
                    <a href="#"  onMouseOver="window.status='';return true">Cancel</a>
                    </td></tr>
    <%          }
                else {
    %>
                        <tr><td colspan='2' align='center'><font class='NArialL'>No Alarms found under this category</font></td></tr>
    <%
                } // end of the else block of arraylist
    %>
            </table>

            </div>
            </td></tr>
            <tr><td><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=1></td></tr>

    <%
            index ++;
            }  // end of the while block of Hashmap iterator


        } // end of else block of if(alarmMap == null) || (alarmMap.isEmpty() == true)
    %>

</table>

</html:form>
</TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
<TR>
  <TD bgcolor="#ffffff">
  <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
  <TD bgcolor="#ffffff"><IMG height=100 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
  <TD valign="top" width="80%">

  <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<html:form name='discrepancyLots' type='com.scalar.chiptrack.ChipTrackActionForm' action='/discrepancyLotsNotifications'>
    <table align="left" border="0" width="85%">
    <tr>
        <td>
            <center><span class="NArialW"><img src='<%=chipTracContext%>/jsp/includes/images/alarm_icon.jpg' height='46' width='34'>&nbsp;Discrepancy Lot Notifications </span></center>
        </td>
    </tr>
    <a name="#top"/>
    <tr><td><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=30></td></tr>
    <tr>
        <td colspan=8 class="NArialL" align='center'>
            Please&nbsp;<a href="javascript:closedlotnotifications();" onMouseOver="window.status='Click here to view closed lot notifications';return true" onmouseout="window.status='';return true">click here</a>&nbsp;to view the Closed Discrepancy Lot Notifications
        </td>
    </tr>
    <tr><td colspan=8 align="left" class='NArialL'>&nbsp;</td></tr>
                <%
        HashMap discrepancyLotsMap = null;
        try
        {
            discrepancyLotsMap = DiscrepancyLotsNotificationsDAO.loadDiscrepancyLotsByStatus(Constants.STATUS_OPEN );
        }
        catch(Exception e)
        {

        }
        if ((discrepancyLotsMap == null) || (discrepancyLotsMap.isEmpty()))
        {
                %>
    <tr><td align='center'><font class='NArialL'><font color='green'>No Notifications</font></font></td></tr>
                <%
        }
        else
        {
            Iterator keys = discrepancyLotsMap.keySet().iterator();
            String key = null;
            ArrayList lotsList = null;
            DiscrepancyLot discrepancyLot = null;

            String headValue = null;
            String linkValue = null;
            String showHide = null;
                %>
    <tr><td align='center'><font class='NArialS'><font color='blue'>[Click on bars to Expand or Collapse the List]</font></font></td></tr>
                <%
            while (keys.hasNext())
            {
                key = (String) keys.next();
                lotsList = (ArrayList) discrepancyLotsMap.get (key);
                headValue = "head" + index;
                linkValue = "link" + index;
                showHide = "ShowHide(" + index + ")";
                %>
    <tr><td ID='<%=headValue%>' ALIGN='left' CLASS="HEADING" ONCLICK='<%=showHide%>'  onMouseOver="window.status='Click here to Expand/Collapse';return true" onmouseout="window.status='';return true"><%=key%> Notifications</td></tr>
    <tr><td ALIGN="left" bgcolor="#FFFFFF">
    <div ID='<%=linkValue%>' CLASS="LINKSOFF">
        <table border="0" width="100%"  align=left>
            <tr><td><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=5></td></tr>
            <tr bgcolor="#993333">
                <td width='20%' align='center'><font class='NArialL'><font color='#FFFFFF'>Select to Remove</font></font>
                </td>
                <td><font class='NArialL'><font color='#FFFFFF'>Lot Number</font></font></td>
                            <%
                    if( Constants.MISSMATCH_OF_TESTED_QTY_AND_GDPW.equalsIgnoreCase(key) ||  Constants.MRB_LOTS_DISPOSITION.equalsIgnoreCase(key))
                    {
                            %>
                        <td><font class='NArialL'><font color='#FFFFFF'>Wafer Id</font></font></td>
                        <td><font class='NArialL'><font color='#FFFFFF'>Vendor</font></font></td>
                            <%
                    }
                    else if( Constants.YIELD_DROPPED_BY_80_PERCENT.equalsIgnoreCase(key) || Constants.YIELD_GREATER_THAN_100_PERCENT.equalsIgnoreCase(key))
                    {
                            %>
                        <td><font class='NArialL'><font color='#FFFFFF'>Previous Process</font></font></td>
                        <td><font class='NArialL'><font color='#FFFFFF'>Current Process</font></font></td>
                        <td><font class='NArialL'><font color='#FFFFFF'>Previous Quantity</font></font></td>
                        <td><font class='NArialL'><font color='#FFFFFF'>Current Quantity</font></font></td>
                            <%
                    }
                    else if( Constants.MISSMATCH_OF_SHIPPED_QTY_AND_RECEIVED_QTY.equalsIgnoreCase(key))
                    {
                            %>
                        <td><font class='NArialL'><font color='#FFFFFF'>Wip Quantity</font></font></td>
                        <td><font class='NArialL'><font color='#FFFFFF'>Ship Quantity</font></font></td>
                        <td><font class='NArialL'><font color='#FFFFFF'>Current Process</font></font></td>
                           <%
                   }
                           %>
               <td><font class='NArialL'><font color='#FFFFFF'>Notification Date</font></font></td>
            </tr>
            <tr bgcolor="#FFFFEE">
                <td width='20%' align='center'> <font class='NArialL'><input  type="checkbox" name='<%="notificationType"+index+"_1"%>'  value='<%="notificationType"+index%>' onClick = "javascript:setSelectAll_sd(this)" >Select All</font></td>
                            <%
                    if( Constants.MISSMATCH_OF_TESTED_QTY_AND_GDPW.equalsIgnoreCase(key) ||  Constants.MRB_LOTS_DISPOSITION.equalsIgnoreCase(key))
                    {
                            %>
                        <td colspan='3'><font class='NArialL'><font color='#FFFFFF'>&nbsp;&nbsp;</font></font></td>
                            <%
                    }
                    else if( Constants.YIELD_DROPPED_BY_80_PERCENT.equalsIgnoreCase(key) || Constants.YIELD_GREATER_THAN_100_PERCENT.equalsIgnoreCase(key))
                    {
                            %>
                        <td colspan='5'><font class='NArialL'><font color='#FFFFFF'>&nbsp;&nbsp;</font></font></td>
                            <%
                    }
                    else if( Constants.MISSMATCH_OF_SHIPPED_QTY_AND_RECEIVED_QTY.equalsIgnoreCase(key))
                    {
                            %>
                        <td colspan='4'><font class='NArialL'><font color='#FFFFFF'>&nbsp;&nbsp;</font></font></td>
                            <%
                    }
                            %>
                    <td><font class='NArialL'><font color='#FFFFFF'>&nbsp;&nbsp;</font></font></td>
                </tr>
                        <%
                    if ((lotsList != null) && (!lotsList.isEmpty()))
                    {
                        int size = lotsList.size();
                        String bgColor[] = {"#DEE1E2", "#FFFFEE"};
                        for (int i=0; i<size; i++)
                        {
                            discrepancyLot = (DiscrepancyLot) lotsList.get (i);
                        %>
            <tr bgcolor='<%=bgColor[i%2]%>'>
                <td width='20%' align='center'><font class='NArialL'><input  type='checkbox' name='<%="notificationType"+index%>' value='<%=discrepancyLot.getNotificationId()%>' onClick ="javascript:deSelectAll_sd(this)"></font></td>
                <td>
                    <font class='NArialL'><%=discrepancyLot.getLotNumber()%></font>
                </td>
                            <%
                    if( Constants.MISSMATCH_OF_TESTED_QTY_AND_GDPW.equalsIgnoreCase(key) ||  Constants.MRB_LOTS_DISPOSITION.equalsIgnoreCase(key))
                    {
                            %>
                        <td><font class='NArialL'><%=discrepancyLot.getWaferId()%></font></td>
                        <td><font class='NArialL'><%=discrepancyLot.getVendor()%></font></td>
                            <%
                    }
                    else if( Constants.YIELD_DROPPED_BY_80_PERCENT.equalsIgnoreCase(key) || Constants.YIELD_GREATER_THAN_100_PERCENT.equalsIgnoreCase(key))
                    {
                            %>
                        <td><font class='NArialL'><%=discrepancyLot.getPrevProcess()%></font></td>
                        <td><font class='NArialL'><%=discrepancyLot.getCurrentProcess()%></font></td>
                        <td><font class='NArialL'><%=discrepancyLot.getPrevQty()%></font></td>
                        <td><font class='NArialL'><%=discrepancyLot.getCurrentQty()%></font></td>
                            <%
                    }
                    else if( Constants.MISSMATCH_OF_SHIPPED_QTY_AND_RECEIVED_QTY.equalsIgnoreCase(key))
                    {
                            %>
                        <td><font class='NArialL'><%=discrepancyLot.getCurrentQty()%></font></td>
                        <td><font class='NArialL'><%=discrepancyLot.getShipQty()%></font></td>
                        <td><font class='NArialL'><%=discrepancyLot.getCurrentProcess()%></font></td>
                            <%
                    }
                            %>
                    <td>
                        <font class='NArialL'><%=discrepancyLot.getNotificationDate() %></font>
                    </td>
            </tr>
                        <%
                        }
                        %>
            <tr bgcolor="#FFFFEE">
                <td width='20%' align='center'> <font class='NArialL'><input  type="checkbox" name='<%="notificationType"+index+"_2"%>'  value='<%="notificationType"+index%>' onClick = "javascript:setSelectAll_sd(this)" >Select All</font></td>
                            <%
                    if( Constants.MISSMATCH_OF_TESTED_QTY_AND_GDPW.equalsIgnoreCase(key) ||  Constants.MRB_LOTS_DISPOSITION.equalsIgnoreCase(key))
                    {
                            %>
                        <td colspan='3'><font class='NArialL'><font color='#FFFFFF'>&nbsp;&nbsp;</font></font></td>
                            <%
                    }
                    else if( Constants.YIELD_DROPPED_BY_80_PERCENT.equalsIgnoreCase(key) || Constants.YIELD_GREATER_THAN_100_PERCENT.equalsIgnoreCase(key))
                    {
                            %>
                        <td colspan='5'><font class='NArialL'><font color='#FFFFFF'>&nbsp;&nbsp;</font></font></td>
                            <%
                    }
                    else if( Constants.MISSMATCH_OF_SHIPPED_QTY_AND_RECEIVED_QTY.equalsIgnoreCase(key))
                    {
                            %>
                        <td colspan='4'><font class='NArialL'><font color='#FFFFFF'>&nbsp;&nbsp;</font></font></td>
                            <%
                    }
                            %>
                    <td><font class='NArialL'><font color='#FFFFFF'>&nbsp;&nbsp;</font></font></td>
            </tr>
            <tr><td colspan='2'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10/></td></tr>
            <tr>
                            <%
                    if( Constants.MISSMATCH_OF_TESTED_QTY_AND_GDPW.equalsIgnoreCase(key) ||  Constants.MRB_LOTS_DISPOSITION.equalsIgnoreCase(key))
                    {
                            %>
                        <td align='center' class='NArialL' colspan='5'>
                            <%
                    }
                    else if( Constants.YIELD_DROPPED_BY_80_PERCENT.equalsIgnoreCase(key) || Constants.YIELD_GREATER_THAN_100_PERCENT.equalsIgnoreCase(key))
                    {
                            %>
                        <td align='center' class='NArialL' colspan='7'>
                            <%
                    }
                    else if( Constants.MISSMATCH_OF_SHIPPED_QTY_AND_RECEIVED_QTY.equalsIgnoreCase(key))
                    {
                            %>
                        <td align='center' class='NArialL' colspan='6'>
                            <%
                    }
                    String removeJSFunction = "javascript:removeDiscrepancyLots('notificationType"+index+"');";
                            %>
                    <chiptrack:restrictedLink functionality='<%=Functionality.DISCREPENCY_LOT_NOTIFICATIONS %>' action='<%=User.USER_ACTION_DELETE%>' href='<%=removeJSFunction%>' onmouseover="window.status='Click here to delete the Discrepancy Lots';return true" onmouseout="window.status='';return true">Delete</chiptrack:restrictedLink>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <a href="#"  onMouseOver="window.status='';return true">Top</a>
                </td>
            </tr>
                        <%
                    }
                    else
                    {
                        %>
            <tr><td colspan='2' align='center'><font class='NArialL'>No Alarms found under this category</font></td></tr>
                        <%
                    } // end of the else block of arraylist
                        %>
        </table>
    </div>
    </td></tr>
    <tr><td><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=1></td></tr>
                <%
                index ++;
            }  // end of the while block of Hashmap iterator
        } // end of else block of if(alarmMap == null) || (alarmMap.isEmpty() == true)
                %>

    </table>
</html:form>

<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

</BODY>

</html:html>